<template>
  <div>
    <myheader title="联系我们">
      <template #left>
        <span @click="$router.go(-1)">返回</span>
      </template>
    </myheader>
    <!-- 联系我们 收集联系人信息 -->
    <van-address-edit
      :area-list="areaList"
      show-delete
      save-button-text="提交"
      delete-button-text="取消"
      @save="onSave"
      @delete="onDelete"
      :area-columns-placeholder="['请选择', '请选择', '请选择']"
      @change-detail="onChangeDetail"
    />

    <div class="comm">
      <p>点亮一下小星星吧✨✨✨</p>
      <!-- 评价 -->
      <van-rate
        v-model="value"
        :size="25"
        color="#ffd21e"
        :count="5"
        @change="onChange"
      />
    </div>
  </div>
</template>

<script>
import myheader from "@/components/myheader";

export default {
  data() {
    return {
      value: 2,
      areaList: {
        province_list: {
          110000: "北京市",
          120000: "天津市",
          130000: "广州市",
        },
        city_list: {
          110100: "北京市",
          110200: "县",
          120100: "天津市",
          120200: "县",
          130100: "天河区",
        },
        county_list: {
          110101: "东城区",
          110102: "西城区",
          110105: "朝阳区",
          110106: "丰台区",
          120101: "和平区",
          120102: "河东区",
          120103: "河西区",
          120104: "南开区",
          120105: "河北区",
          130101: "吉山",
        },
      },
      searchResult: [],
    };
  },
  components: {
    myheader,
  },
  methods: {
    onChange(value) {
      console.log(value);
    },
    onSave() {
      this.$toast.success("提交成功");
    },
    onDelete() {},
    onChangeDetail(val) {
      if (val) {
        this.searchResult = [
          {
            name: "黄龙万科中心",
            address: "杭州市西湖区",
          },
        ];
      } else {
        this.searchResult = [];
      }
    },
  },
};
</script>

<style lang="less" scoped>
.comm {
  text-align: center;
  font-size: 18px;
  p {
    margin-bottom: 10px;
  }
}
</style>